package com.wjk.kylin.modules.system.schedule.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wjk.kylin.modules.system.schedule.entity.Schedule;
import com.wjk.kylin.modules.system.schedule.entity.ScheduleLog;
import com.wjk.kylin.modules.system.schedule.mapper.ScheduleLogMapper;
import com.wjk.kylin.modules.system.schedule.mapper.ScheduleMapper;
import com.wjk.kylin.modules.system.schedule.service.IScheduleLogService;
import com.wjk.kylin.modules.system.schedule.service.IScheduleService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Arrays;


/**
 * <p>
 * 定时任务log 服务实现类
 * </p>
 *
 * @author wangjkui
 * @since 2020-06-04
 */
@Service
@Transactional(readOnly = true)
public class ScheduleLogServiceImpl extends ServiceImpl<ScheduleLogMapper, ScheduleLog> implements IScheduleLogService {

    @Override
    public IPage<ScheduleLog> findPage(Page<ScheduleLog> page, ScheduleLog scheduleLog) {
        return baseMapper.findPage(page, scheduleLog);
    }

    @Override
    @Transactional(readOnly = false)
    public boolean save(ScheduleLog scheduleLog) {
        return super.save(scheduleLog);
    }

    @Override
    @Transactional(readOnly = false)
    public boolean deleteByIds(String[] scheduleLogIds) {
        return super.removeByIds(Arrays.asList(scheduleLogIds));
    }

    @Override
    @Transactional(readOnly = false)
    public void clean() {
        baseMapper.clean();
    }
}
